package com.scorpio.appuser.mapper;


import com.scorpio.appuser.dto.UserShopCartDTO;
import com.scorpio.common.dao.BaseDao;
import com.scorpio.appuser.domain.UserShopCartEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户购物车Mapper接口
 *
 * @author scorpio
 * @date 2021-10-29
 */
@Mapper
public interface UserShopCartMapper extends BaseDao<UserShopCartEntity> {

    UserShopCartEntity selectByUser(@Param("uid") Long uid, @Param("id") Long id);

    List<UserShopCartEntity> selectBysUser(@Param("uid") Long uid, @Param("ids") Long[] ids);

    UserShopCartEntity selectBySpec(@Param("uid") Long uid, @Param("specId") Long specId);

    int clearShopCart(@Param("uid") Long uid);

    Integer shopCartTotal(@Param("uid") Long uid);

    List<UserShopCartDTO> appList(@Param("uid") Long uid);

    int updateShopCartCheck(@Param("uid") Long uid, @Param("id") Long id, @Param("isCheck") String isCheck);

    int deleteShopCart(@Param("uid") Long uid, @Param("ids") Long[] ids);
}
